package com.stylefeng.guns.modular.cash.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.modular.system.model.Details;
import com.stylefeng.guns.modular.system.dao.DetailsMapper;
import com.stylefeng.guns.modular.cash.service.IDetailsService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.system.model.Payroll;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author stylefeng123
 * @since 2018-07-03
 */
@Service
public class DetailsServiceImpl extends ServiceImpl<DetailsMapper, Details> implements IDetailsService {

    /**
     * 查询费用类型id
     * @param type
     * @param name
     * @return
     */
    @Override
    public Integer getDetailsID(Integer type, String name) {
        EntityWrapper<Details> wrapper  = new EntityWrapper<>();
        wrapper.eq("type",type);
        wrapper.eq("name",name);
        List<Details> details = this.selectList(wrapper);
        return details.get(0).getId();
    }
}
